package controllers

import (
	"read.com/admin/models"
)

type StatisticController struct {
	BaseController
}

func (self *StatisticController) List() {
	self.Data["pageTitle"] = "订单统计"
	self.display()
}

func (self *StatisticController) Table() {
	startTime := self.GetString("start")
	endTime := self.GetString("end")
	result,err := models.GetCountAndSum(startTime,endTime)
	if err != nil {
		self.ajaxList("失败", MSG_ERR, 0, 0)
	}else {
		self.ajaxList("成功", MSG_OK, 0, result)
	}
}
